const Router = require("koa-router");
const {
  verifyUser,
  handPassword,
  handleAvatar,
  getUserInfo
} = require("../middleware/user.middleware");
const { create, resultUserInfo } = require("../controller/user.controller");
const userRouter = new Router({ prefix: "/user" });
/**
 @route POST /user
 @desc 注册用户
 @access public
 */
userRouter.post("/", verifyUser, handPassword, handleAvatar, create);
/**
 @route GET /user
 @desc 获取用户
 @access public
 */
userRouter.get("/", getUserInfo, resultUserInfo);
module.exports = userRouter;
